package com.tjec.project.projectWorkbench.service.impl;

import java.util.List;
import java.util.UUID;

import com.tjec.common.utils.DateUtils;
import com.tjec.common.utils.SecurityUtils;
import com.tjec.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tjec.project.projectWorkbench.mapper.BmsProjectIndicatorReportMapper;
import com.tjec.project.projectWorkbench.domain.BmsProjectIndicatorReport;
import com.tjec.project.projectWorkbench.service.IBmsProjectIndicatorReportService;

/**
 * 项目指标填报 Service业务层处理
 * 
 * @author cjj
 * @date 2020-05-14
 */
@Service
public class BmsProjectIndicatorReportServiceImpl implements IBmsProjectIndicatorReportService 
{
    @Autowired
    private BmsProjectIndicatorReportMapper bmsProjectIndicatorReportMapper;

    /**
     * 查询项目指标填报 
     * 
     * @param guid 项目指标填报 ID
     * @return 项目指标填报 
     */
    @Override
    public BmsProjectIndicatorReport selectBmsProjectIndicatorReportByGuid(String guid)
    {
        return bmsProjectIndicatorReportMapper.selectBmsProjectIndicatorReportByGuid(guid);
    }

    /**
     * 查询项目指标填报 列表
     * 
     * @param bmsProjectIndicatorReport 项目指标填报 
     * @return 项目指标填报 
     */
    @Override
    public List<BmsProjectIndicatorReport> selectBmsProjectIndicatorReportList(BmsProjectIndicatorReport bmsProjectIndicatorReport)
    {
        return bmsProjectIndicatorReportMapper.selectBmsProjectIndicatorReportList(bmsProjectIndicatorReport);
    }

    /**
     * 新增项目指标填报 
     * 
     * @param bmsProjectIndicatorReport 项目指标填报 
     * @return 结果
     */
    @Override
    public int insertBmsProjectIndicatorReport(BmsProjectIndicatorReport bmsProjectIndicatorReport)
    {
        bmsProjectIndicatorReport.setCreateTime(DateUtils.getNowDate());
        bmsProjectIndicatorReport.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserId());
        if(null==bmsProjectIndicatorReport.getGuid()||("").equals(bmsProjectIndicatorReport.getGuid())){
            bmsProjectIndicatorReport.setGuid(UUID.randomUUID().toString());
        }
        return bmsProjectIndicatorReportMapper.insertBmsProjectIndicatorReport(bmsProjectIndicatorReport);
    }

    /**
     * 修改项目指标填报 
     * 
     * @param bmsProjectIndicatorReport 项目指标填报 
     * @return 结果
     */
    @Override
    public int updateBmsProjectIndicatorReport(BmsProjectIndicatorReport bmsProjectIndicatorReport)
    {
        bmsProjectIndicatorReport.setUpdateTime(DateUtils.getNowDate());
        bmsProjectIndicatorReport.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserId());
        return bmsProjectIndicatorReportMapper.updateBmsProjectIndicatorReport(bmsProjectIndicatorReport);
    }

    /**
     * 批量删除项目指标填报 
     * 
     * @param guids 需要删除的项目指标填报 ID
     * @return 结果
     */
    @Override
    public int deleteBmsProjectIndicatorReportByGuids(String[] guids)
    {
        return bmsProjectIndicatorReportMapper.deleteBmsProjectIndicatorReportByGuids(guids);
    }

    /**
     * 删除项目指标填报 信息
     * 
     * @param guid 项目指标填报 ID
     * @return 结果
     */
    @Override
    public int deleteBmsProjectIndicatorReportByGuid(String guid)
    {
        return bmsProjectIndicatorReportMapper.deleteBmsProjectIndicatorReportByGuid(guid);
    }
}
